package net.models;

// Generated 11 avr. 2013 10:40:17 by Hibernate Tools 3.4.0.CR1

import java.math.BigDecimal;
import java.util.Date;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import static javax.persistence.GenerationType.IDENTITY;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

/**
 * Lignefraishorsforfait generated by hbm2java
 */
@Entity
@Table(name = "lignefraishorsforfait", catalog = "bom")
public class Lignefraishorsforfait extends AbstractModel {

	private Integer id;
	private Fichefrais fichefrais;
	private String libelle;
	private Date dateHf;
	private int montant;

	public Lignefraishorsforfait() {
	}

	public Lignefraishorsforfait(Date dateHf) {
		this.dateHf = dateHf;
	}

	public Lignefraishorsforfait(Fichefrais fichefrais, String libelle,
			Date dateHf, int montant) {
		this.fichefrais = fichefrais;
		this.libelle = libelle;
		this.dateHf = dateHf;
		this.montant = montant;
	}

	@Id
	@GeneratedValue(strategy = IDENTITY)
	@Column(name = "id", unique = true, nullable = false)
	public Integer getId() {
		return this.id;
	}

	public void setId(Integer id) {
		Integer oldValue = this.id;
		this.id = id;
		firePropertyChange("id", oldValue, id);
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "idFichefrais")
	public Fichefrais getFichefrais() {
		return this.fichefrais;
	}

	public void setFichefrais(Fichefrais fichefrais) {
		Fichefrais oldValue = this.fichefrais;
		this.fichefrais = fichefrais;
		firePropertyChange("fichefrais", oldValue, fichefrais);
	}

	@Column(name = "libelle", length = 100)
	public String getLibelle() {
		return this.libelle;
	}

	public void setLibelle(String libelle) {
		String oldValue = this.libelle;
		this.libelle = libelle;
		firePropertyChange("libelle", oldValue, libelle);
	}

	@Temporal(TemporalType.DATE)
	@Column(name = "dateHF", nullable = false, length = 10)
	public Date getDateHf() {
		return this.dateHf;
	}

	public void setDateHf(Date dateHf) {
		Date oldValue = this.dateHf;
		this.dateHf = dateHf;
		firePropertyChange("dateHf", oldValue, dateHf);
	}

	@Column(name = "montant", precision = 10)
	public int getMontant() {
		return this.montant;
	}

	public void setMontant(int montant) {
		int oldValue = this.montant;
		this.montant = montant;
		firePropertyChange("montant", oldValue, montant);
	}
	
	@Override
	public boolean equals(Object obj) {
		if(obj instanceof Lignefraishorsforfait)
			return ((Lignefraishorsforfait)obj).getId().equals(id);
		return super.equals(obj);
	}

}
